package org.boot.easyapi.permission.service;

import org.boot.easyapi.permission.entity.PermissionDO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface PermissionService {

    void insert(PermissionDO p);

    void update(PermissionDO p);

    void delete(Long id);

    PermissionDO findById(Long id);

    List<PermissionDO> findList(PermissionDO permission);

    /**
     * 插入默认路径权限
     */
    void insertDefaultPathRule(PermissionDO permissionDO);

    /**
     * 插入路径权限
     */
    void insertPathRule(PermissionDO permissionDO);

    /**
     * 插入ip权限
     */
    void insertIpRule(PermissionDO permissionDO);

    /**
     * 检查路径是否有权限
     */
    boolean hasPathPermission(HttpServletRequest request);

    /**
     * 检查ip是否有权限
     */
    boolean hasIpPermission(HttpServletRequest request);





}
